
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: class Resource</title>
</head><body bgcolor="#f0f0f8">
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Resource">class <strong>Resource</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>A&nbsp;class&nbsp;for&nbsp;interacting&nbsp;with&nbsp;a&nbsp;resource.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Resource-__init__"><strong>__init__</strong></a>(self)</dt></dl>

<dl><dt><a name="Resource-delete"><strong>delete</strong></a> = method(self, **kwargs)</dt><dd><tt>Delete&nbsp;a&nbsp;task&nbsp;from&nbsp;a&nbsp;TaskQueue.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;task:&nbsp;string,&nbsp;The&nbsp;id&nbsp;of&nbsp;the&nbsp;task&nbsp;to&nbsp;delete.&nbsp;(required)<br>
&nbsp;&nbsp;taskqueue:&nbsp;string,&nbsp;The&nbsp;taskqueue&nbsp;to&nbsp;delete&nbsp;a&nbsp;task&nbsp;from.&nbsp;(required)<br>
&nbsp;&nbsp;project:&nbsp;string,&nbsp;The&nbsp;project&nbsp;under&nbsp;which&nbsp;the&nbsp;queue&nbsp;lies.&nbsp;(required)</tt></dd></dl>

<dl><dt><a name="Resource-get"><strong>get</strong></a> = method(self, **kwargs)</dt><dd><tt>Get&nbsp;a&nbsp;particular&nbsp;task&nbsp;from&nbsp;a&nbsp;TaskQueue.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;task:&nbsp;string,&nbsp;The&nbsp;task&nbsp;to&nbsp;get&nbsp;properties&nbsp;of.&nbsp;(required)<br>
&nbsp;&nbsp;taskqueue:&nbsp;string,&nbsp;The&nbsp;taskqueue&nbsp;in&nbsp;which&nbsp;the&nbsp;task&nbsp;belongs.&nbsp;(required)<br>
&nbsp;&nbsp;project:&nbsp;string,&nbsp;The&nbsp;project&nbsp;under&nbsp;which&nbsp;the&nbsp;queue&nbsp;lies.&nbsp;(required)<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;An&nbsp;object&nbsp;of&nbsp;the&nbsp;form<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;"kind":&nbsp;"taskqueues#task",&nbsp;#&nbsp;The&nbsp;kind&nbsp;of&nbsp;object&nbsp;returned,&nbsp;in&nbsp;this&nbsp;case&nbsp;set&nbsp;to&nbsp;task.<br>
&nbsp;&nbsp;&nbsp;&nbsp;"leaseTimestamp":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;Time&nbsp;(in&nbsp;seconds&nbsp;since&nbsp;the&nbsp;epoch)&nbsp;at&nbsp;which&nbsp;the&nbsp;task&nbsp;lease&nbsp;will&nbsp;expire.&nbsp;This&nbsp;value&nbsp;is&nbsp;0&nbsp;if&nbsp;the&nbsp;task&nbsp;isnt&nbsp;currently&nbsp;leased&nbsp;out&nbsp;to&nbsp;a&nbsp;worker.<br>
&nbsp;&nbsp;&nbsp;&nbsp;"id":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;Name&nbsp;of&nbsp;the&nbsp;task.<br>
&nbsp;&nbsp;&nbsp;&nbsp;"payloadBase64":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;A&nbsp;bag&nbsp;of&nbsp;bytes&nbsp;which&nbsp;is&nbsp;the&nbsp;task&nbsp;payload.&nbsp;The&nbsp;payload&nbsp;on&nbsp;the&nbsp;JSON&nbsp;side&nbsp;is&nbsp;always&nbsp;Base64&nbsp;encoded.<br>
&nbsp;&nbsp;&nbsp;&nbsp;"queueName":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;Name&nbsp;of&nbsp;the&nbsp;queue&nbsp;that&nbsp;the&nbsp;task&nbsp;is&nbsp;in.<br>
&nbsp;&nbsp;&nbsp;&nbsp;"enqueueTimestamp":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;Time&nbsp;(in&nbsp;seconds&nbsp;since&nbsp;the&nbsp;epoch)&nbsp;at&nbsp;which&nbsp;the&nbsp;task&nbsp;was&nbsp;enqueued.<br>
&nbsp;&nbsp;}</tt></dd></dl>

<dl><dt><a name="Resource-lease"><strong>lease</strong></a> = method(self, **kwargs)</dt><dd><tt>Lease&nbsp;1&nbsp;or&nbsp;more&nbsp;tasks&nbsp;from&nbsp;a&nbsp;TaskQueue.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;leaseSecs:&nbsp;integer,&nbsp;The&nbsp;lease&nbsp;in&nbsp;seconds.&nbsp;(required)<br>
&nbsp;&nbsp;taskqueue:&nbsp;string,&nbsp;The&nbsp;taskqueue&nbsp;to&nbsp;lease&nbsp;a&nbsp;task&nbsp;from.&nbsp;(required)<br>
&nbsp;&nbsp;project:&nbsp;string,&nbsp;The&nbsp;project&nbsp;under&nbsp;which&nbsp;the&nbsp;queue&nbsp;lies.&nbsp;(required)<br>
&nbsp;&nbsp;numTasks:&nbsp;integer,&nbsp;The&nbsp;number&nbsp;of&nbsp;tasks&nbsp;to&nbsp;lease.&nbsp;(required)<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;An&nbsp;object&nbsp;of&nbsp;the&nbsp;form<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;"items":&nbsp;[&nbsp;#&nbsp;The&nbsp;actual&nbsp;list&nbsp;of&nbsp;tasks&nbsp;returned&nbsp;as&nbsp;a&nbsp;result&nbsp;of&nbsp;the&nbsp;lease&nbsp;operation.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"kind":&nbsp;"taskqueues#task",&nbsp;#&nbsp;The&nbsp;kind&nbsp;of&nbsp;object&nbsp;returned,&nbsp;in&nbsp;this&nbsp;case&nbsp;set&nbsp;to&nbsp;task.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"leaseTimestamp":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;Time&nbsp;(in&nbsp;seconds&nbsp;since&nbsp;the&nbsp;epoch)&nbsp;at&nbsp;which&nbsp;the&nbsp;task&nbsp;lease&nbsp;will&nbsp;expire.&nbsp;This&nbsp;value&nbsp;is&nbsp;0&nbsp;if&nbsp;the&nbsp;task&nbsp;isnt&nbsp;currently&nbsp;leased&nbsp;out&nbsp;to&nbsp;a&nbsp;worker.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"id":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;Name&nbsp;of&nbsp;the&nbsp;task.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"payloadBase64":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;A&nbsp;bag&nbsp;of&nbsp;bytes&nbsp;which&nbsp;is&nbsp;the&nbsp;task&nbsp;payload.&nbsp;The&nbsp;payload&nbsp;on&nbsp;the&nbsp;JSON&nbsp;side&nbsp;is&nbsp;always&nbsp;Base64&nbsp;encoded.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"queueName":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;Name&nbsp;of&nbsp;the&nbsp;queue&nbsp;that&nbsp;the&nbsp;task&nbsp;is&nbsp;in.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"enqueueTimestamp":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;Time&nbsp;(in&nbsp;seconds&nbsp;since&nbsp;the&nbsp;epoch)&nbsp;at&nbsp;which&nbsp;the&nbsp;task&nbsp;was&nbsp;enqueued.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<br>
&nbsp;&nbsp;&nbsp;&nbsp;],<br>
&nbsp;&nbsp;&nbsp;&nbsp;"kind":&nbsp;"taskqueue#tasks",&nbsp;#&nbsp;The&nbsp;kind&nbsp;of&nbsp;object&nbsp;returned,&nbsp;a&nbsp;list&nbsp;of&nbsp;tasks.<br>
&nbsp;&nbsp;}</tt></dd></dl>

<dl><dt><a name="Resource-list"><strong>list</strong></a> = method(self, **kwargs)</dt><dd><tt>List&nbsp;Tasks&nbsp;in&nbsp;a&nbsp;TaskQueue<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;taskqueue:&nbsp;string,&nbsp;The&nbsp;id&nbsp;of&nbsp;the&nbsp;taskqueue&nbsp;to&nbsp;list&nbsp;tasks&nbsp;from.&nbsp;(required)<br>
&nbsp;&nbsp;project:&nbsp;string,&nbsp;The&nbsp;project&nbsp;under&nbsp;which&nbsp;the&nbsp;queue&nbsp;lies.&nbsp;(required)<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;An&nbsp;object&nbsp;of&nbsp;the&nbsp;form<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;"items":&nbsp;[&nbsp;#&nbsp;The&nbsp;actual&nbsp;list&nbsp;of&nbsp;tasks&nbsp;currently&nbsp;active&nbsp;in&nbsp;the&nbsp;TaskQueue.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"kind":&nbsp;"taskqueues#task",&nbsp;#&nbsp;The&nbsp;kind&nbsp;of&nbsp;object&nbsp;returned,&nbsp;in&nbsp;this&nbsp;case&nbsp;set&nbsp;to&nbsp;task.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"leaseTimestamp":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;Time&nbsp;(in&nbsp;seconds&nbsp;since&nbsp;the&nbsp;epoch)&nbsp;at&nbsp;which&nbsp;the&nbsp;task&nbsp;lease&nbsp;will&nbsp;expire.&nbsp;This&nbsp;value&nbsp;is&nbsp;0&nbsp;if&nbsp;the&nbsp;task&nbsp;isnt&nbsp;currently&nbsp;leased&nbsp;out&nbsp;to&nbsp;a&nbsp;worker.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"id":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;Name&nbsp;of&nbsp;the&nbsp;task.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"payloadBase64":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;A&nbsp;bag&nbsp;of&nbsp;bytes&nbsp;which&nbsp;is&nbsp;the&nbsp;task&nbsp;payload.&nbsp;The&nbsp;payload&nbsp;on&nbsp;the&nbsp;JSON&nbsp;side&nbsp;is&nbsp;always&nbsp;Base64&nbsp;encoded.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"queueName":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;Name&nbsp;of&nbsp;the&nbsp;queue&nbsp;that&nbsp;the&nbsp;task&nbsp;is&nbsp;in.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"enqueueTimestamp":&nbsp;"A&nbsp;String",&nbsp;#&nbsp;Time&nbsp;(in&nbsp;seconds&nbsp;since&nbsp;the&nbsp;epoch)&nbsp;at&nbsp;which&nbsp;the&nbsp;task&nbsp;was&nbsp;enqueued.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<br>
&nbsp;&nbsp;&nbsp;&nbsp;],<br>
&nbsp;&nbsp;&nbsp;&nbsp;"kind":&nbsp;"taskqueues#tasks",&nbsp;#&nbsp;The&nbsp;kind&nbsp;of&nbsp;object&nbsp;returned,&nbsp;a&nbsp;list&nbsp;of&nbsp;tasks.<br>
&nbsp;&nbsp;}</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table>
</body></html>